package com.demo.api;

import com.jfinal.weixin.sdk.api.ApiResult;
/**
 *  消息模板推送
 */
public class PushTemp {
	public static ApiResult pushWxTemp(String openid,String tempid,String url ,String content){

		//检查用户是否可用
	//	boolean subscribe = Temaple.isSubscribe(openid);
	//	if (subscribe){
			// 内容 json
			String data=" \"data\":{\"content\": { \"value\":\""+content+"\",\"color\":\"#173177\"}}";

			String json="   {\n" +
					"           \"touser\":\""+openid+"\",\n" +
					"           \"template_id\":\""+tempid+"\",\n" +
					"           \"topcolor\":\"#FF0000\",\n" +
					data+
					"       }";

			ApiResult apiResult = Temaple.sendTemp(json);
			return apiResult;
//		}else {
//			System.out.println("用户不可用...");
//			return null;
//		}

	}
}
